
package com.zsrt.day20170504.ch06;

public class Buyer extends Thread{

	private Ticket tick;
	
	public Buyer(Ticket tick){
		this.tick = tick;
	}
	
	@Override
	public void run() {
		while (true) {
			String string = tick.sell(Thread.currentThread().getName());
			if(string.equals(null)) break;
			System.out.println(string);
			
			try {
				sleep(1);
			} catch (InterruptedException e) {
			}
		}
	}
}
